package cn.diancan.model;

import org.hibernate.annotations.OptimisticLockType;
import org.hibernate.annotations.OptimisticLocking;

import javax.persistence.*;

@Entity
@Table( uniqueConstraints = {@UniqueConstraint(columnNames="createDate")})
@OptimisticLocking(type= OptimisticLockType.VERSION)
public class PurchaseSaleOrderNumber {

	private Long id;

	private String createDate; //创建日期
	private String dateTime;
	private Long startNumber;
	private Integer count;
	private Integer version;

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getDateTime() {
		return dateTime;
	}
	public void setDateTime(String dateTime) {
		this.dateTime = dateTime;
	}

	public Long getStartNumber() {
		return startNumber;
	}

	public void setStartNumber(Long startNumber) {
		this.startNumber = startNumber;
	}

	@Column(columnDefinition = "DATE")
	public String getCreateDate() {
		return createDate;
	}

	public void setCreateDate(String createDate) {
		this.createDate = createDate;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	@Version
	@Column(name="OPTLOCK",columnDefinition = "int(11) default 0")
	public Integer getVersion() {
		return version;
	}
	public void setVersion(Integer version) {
		this.version = version;
	}
	
}
